#include<iostream>
#include<algorithm>
typedef long long LL;
using namespace std;

LL fun(int x) {
	LL ans = 0;
	for (int i = 1; i <= x / i; i++) {
		if (x % i == 0) {
			ans += i;
			if (i * i != x) {
				ans += x / i;
			}
		}
	}

	return ans-x;

}

int main() {
	int n;
   // cout << fun(284);
	cin >> n;
	for (int i = n;; i++) {
		LL ans1 = fun(i);
		if (ans1 == i)continue;
		LL ans2 = fun(ans1);
		if (ans2 == i) {
			cout << i << " " << ans1 << endl;
			break;
		}
	}


	return 0;
}